package com.hzsk.lisence.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty.Access;
import javax.persistence.*;
import java.sql.Timestamp;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "lisence_user")
public class LisenceUserEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "user_id")
    private Integer userId;

    @Column(name = "grouping_id",columnDefinition = "Integer(11) DEFAULT NULL comment '组织id'")
    private Integer groupingId;

    @Column(name = "user_account", columnDefinition = "varchar(255) default ''   comment '账号'")
    private String userAccount;

    @Column(name = "user_num", columnDefinition = "varchar(255) default ''   comment '员工工号'")
    private String userNum;

    @Column(name = "corporate_id", columnDefinition = "Integer(11) DEFAULT NULL comment '组织id'")
    private Integer corporateId;

    @Column(name = "password", columnDefinition = "varchar(255) default ''  comment '密码'")
    private String password;

    @Column(name = "user_name", columnDefinition = "varchar(255) default '' comment '用户名'")
    private String userName;

    @Column(name = "user_describe",  columnDefinition = "varchar(255) default '' comment '用户描述'")
    private String userDescribe;

    @Column(name = "phone_number",columnDefinition = "varchar(255) default '' comment '电话号码'")
    private String phoneNumber;

//    @Column(name = "user_role", columnDefinition = "varchar(255) default '' comment 'super为超级管理员、empower为授权管理员、ordinary普通用户、'")
    @Column(name = "user_role", columnDefinition = "varchar(255) default '' comment 'SUPER为超级管理员、PRODUCE_LEADER为生产领导、PRODUCE_MANAGER为生产主管、PRODUCER为生产员、SOFTWARE_MANAGER为软件产品经理'")
    private String userRole;

    @Column(name = "flag",columnDefinition = "Integer(11) DEFAULT NULL comment '标识 0为正常、1为禁用'")
    @ApiModelProperty(value = "标识 0为正常、1为禁用")
    @JsonIgnore
    private Integer flag;

    @Column(name ="update_time")
    @ApiModelProperty(value = "修改时间")
    @JsonIgnore
    private Timestamp updateTime;

    @Column(name ="create_time",columnDefinition = "datetime DEFAULT NULL  comment '创建时间'")
    @ApiModelProperty(value = "创建时间")
    private Timestamp createTime;

    @Transient
    @JsonProperty(access = Access.WRITE_ONLY)
    @ApiModelProperty(value = "创建人 后续根据此区分用户所属授权管理人员")
    private Integer operatorUserId;


    @Transient
    @ApiModelProperty(value = "返回token信息")
    private String token;

    @Transient
    @ApiModelProperty(value = "返回组织类型")
    private String groupingType;

    @Transient
    @ApiModelProperty(value = "返回组织名称")
    private String groupingName;

    @Transient
    @ApiModelProperty(value = "返回组织名称")
    private String corporateName;


}
